#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2018/7/11 21:52
# @Author  : hyang
# @File    : settings.py
# @Software: python_utils

import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

HOST = '127.0.0.1'
PORT = 9009

USER_HOME_DIR = os.path.join(BASE_DIR, 'home')
ACCOUNT_FILE = "%s/conf/accounts.ini" % BASE_DIR

MAX_SOCKET_LISTEN = 5
GET_FILE_PATH = os.path.join(BASE_DIR, 'sharefile', 'get')  # 存放从服务器下载文件路径
PUT_FILE_PATH = os.path.join(BASE_DIR, 'sharefile', 'put')  # 存放客户端要上传文件路径


SHELVE_DB = os.path.join(BASE_DIR, 'db')
# 日志参数
log_file = os.path.join(BASE_DIR, 'log', 'access.log')

max_bytes_each = 1024*1000

backup_count = 10

logger_name = 'access'

fmt = '%(asctime)s %(filename)s[line: %(lineno)d] %(levelname)s: %(message)s'

datefmt = '%Y-%m-%d %H:%M:%S'

log_level_in_console = 10

log_level_in_logfile = 10

console_log_on = 1

logfile_log_on = 1

# 日志级别：CRITICAL = 50 ERROR = 40 WARNING = 30 INFO = 20 DEBUG = 10 NOTSET = 0

# console_log_on  = 1 开启控制台日志，logfile_log_on = 1 开启文件日志
